/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author java
 */
@Entity
@Table(name = "LINES")
@NamedQueries({
    @NamedQuery(name = "Line.findAll", query = "SELECT l FROM Line l"),
    @NamedQuery(name = "Line.findById", query = "SELECT l FROM Line l WHERE l.id = :id"),
    @NamedQuery(name = "Line.findByItemId", query = "SELECT l FROM Line l WHERE l.itemId = :itemId"),
    @NamedQuery(name = "Line.findByBarCode", query = "SELECT l FROM Line l WHERE l.barCode = :barCode"),
    @NamedQuery(name = "Line.findByTelNumber", query = "SELECT l FROM Line l WHERE l.telNumber = :telNumber"),
    @NamedQuery(name = "Line.findByLineSerial", query = "SELECT l FROM Line l WHERE l.lineSerial = :lineSerial"),
    @NamedQuery(name = "Line.findByLinePrice", query = "SELECT l FROM Line l WHERE l.linePrice = :linePrice"),
    @NamedQuery(name = "Line.findByPurcItemId", query = "SELECT l FROM Line l WHERE l.purcItemId = :purcItemId"),
    @NamedQuery(name = "Line.findByPurcItemViewNo", query = "SELECT l FROM Line l WHERE l.purcItemViewNo = :purcItemViewNo"),
    @NamedQuery(name = "Line.findByPurcItemDate", query = "SELECT l FROM Line l WHERE l.purcItemDate = :purcItemDate"),
    @NamedQuery(name = "Line.findByDeliverItemTf", query = "SELECT l FROM Line l WHERE l.deliverItemTf = :deliverItemTf"),
    @NamedQuery(name = "Line.findByDeliverItemId", query = "SELECT l FROM Line l WHERE l.deliverItemId = :deliverItemId"),
    @NamedQuery(name = "Line.findByDeliverItemViewNo", query = "SELECT l FROM Line l WHERE l.deliverItemViewNo = :deliverItemViewNo"),
    @NamedQuery(name = "Line.findByDeliverItemDate", query = "SELECT l FROM Line l WHERE l.deliverItemDate = :deliverItemDate"),
    @NamedQuery(name = "Line.findBySaleItemTf", query = "SELECT l FROM Line l WHERE l.saleItemTf = :saleItemTf"),
    @NamedQuery(name = "Line.findBySaleItemId", query = "SELECT l FROM Line l WHERE l.saleItemId = :saleItemId"),
    @NamedQuery(name = "Line.findBySaleItemViewNo", query = "SELECT l FROM Line l WHERE l.saleItemViewNo = :saleItemViewNo"),
    @NamedQuery(name = "Line.findBySaleItemDate", query = "SELECT l FROM Line l WHERE l.saleItemDate = :saleItemDate"),
    @NamedQuery(name = "Line.findByBlueContTf", query = "SELECT l FROM Line l WHERE l.blueContTf = :blueContTf"),
    @NamedQuery(name = "Line.findByBlueContDate", query = "SELECT l FROM Line l WHERE l.blueContDate = :blueContDate"),
    @NamedQuery(name = "Line.findByBlueContPrice", query = "SELECT l FROM Line l WHERE l.blueContPrice = :blueContPrice"),
    @NamedQuery(name = "Line.findBySendBlueTf", query = "SELECT l FROM Line l WHERE l.sendBlueTf = :sendBlueTf"),
    @NamedQuery(name = "Line.findBySendBlueDate", query = "SELECT l FROM Line l WHERE l.sendBlueDate = :sendBlueDate"),
    @NamedQuery(name = "Line.findBySendWhiteTf", query = "SELECT l FROM Line l WHERE l.sendWhiteTf = :sendWhiteTf"),
    @NamedQuery(name = "Line.findBySendWhiteDate", query = "SELECT l FROM Line l WHERE l.sendWhiteDate = :sendWhiteDate"),
    @NamedQuery(name = "Line.findByWhiteContPrice", query = "SELECT l FROM Line l WHERE l.whiteContPrice = :whiteContPrice"),
    @NamedQuery(name = "Line.findByContRetTf", query = "SELECT l FROM Line l WHERE l.contRetTf = :contRetTf"),
    @NamedQuery(name = "Line.findByContRetDate", query = "SELECT l FROM Line l WHERE l.contRetDate = :contRetDate"),
    @NamedQuery(name = "Line.findByContRetNote", query = "SELECT l FROM Line l WHERE l.contRetNote = :contRetNote"),
    @NamedQuery(name = "Line.findByReturnPurcItemTf", query = "SELECT l FROM Line l WHERE l.returnPurcItemTf = :returnPurcItemTf"),
    @NamedQuery(name = "Line.findByReturnPurcItemDate", query = "SELECT l FROM Line l WHERE l.returnPurcItemDate = :returnPurcItemDate"),
    @NamedQuery(name = "Line.findByReturnPurcItemId", query = "SELECT l FROM Line l WHERE l.returnPurcItemId = :returnPurcItemId")})
public class Line implements Serializable {
	
    private static final long serialVersionUID = 1L;
    
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;
    
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "ITEM_ID")
    private int itemId;
    
    @Size(max = 50)
    @Column(name = "BAR_CODE")
    private String barCode;
    
    @Size(max = 50)
    @Column(name = "TEL_NUMBER")
    private String telNumber;
    
    @Size(max = 50)
    @Column(name = "LINE_SERIAL")
    private String lineSerial;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "LINE_PRICE")
    private Double linePrice;
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "PURC_ITEM_ID")
    private int purcItemId;
    
    @Column(name = "PURC_ITEM_VIEW_NO")
    private Integer purcItemViewNo;
    
    @Column(name = "PURC_ITEM_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date purcItemDate;
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "DELIVER_ITEM_TF")
    private boolean deliverItemTf;
    
    @Column(name = "DELIVER_ITEM_ID")
    private Integer deliverItemId;
    
    @Column(name = "DELIVER_ITEM_VIEW_NO")
    private Integer deliverItemViewNo;
    
    @Column(name = "DELIVER_ITEM_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date deliverItemDate;
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "SALE_ITEM_TF")
    private boolean saleItemTf;
    
    @Column(name = "SALE_ITEM_ID")
    private Integer saleItemId;
    
    @Size(max = 10)
    @Column(name = "SALE_ITEM_VIEW_NO")
    private String saleItemViewNo;
    
    @Column(name = "SALE_ITEM_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date saleItemDate;
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "BLUE_CONT_TF")
    private boolean blueContTf;
    
    @Column(name = "BLUE_CONT_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date blueContDate;
    
    @Column(name = "BLUE_CONT_PRICE")
    private Double blueContPrice;
    
    @Column(name = "SEND_BLUE_TF")
    private Boolean sendBlueTf;
    
    @Column(name = "SEND_BLUE_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date sendBlueDate;
    
    @Column(name = "SEND_WHITE_TF")
    private Boolean sendWhiteTf;
    
    @Column(name = "SEND_WHITE_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date sendWhiteDate;
    
    @Column(name = "WHITE_CONT_PRICE")
    private Double whiteContPrice;
    
    @Column(name = "CONT_RET_TF")
    private Boolean contRetTf;
    
    @Column(name = "CONT_RET_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date contRetDate;
    
    @Size(max = 50)
    @Column(name = "CONT_RET_NOTE")
    private String contRetNote;
    
    @Column(name = "RETURN_PURC_ITEM_TF")
    private Boolean returnPurcItemTf;
    
    @Column(name = "RETURN_PURC_ITEM_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date returnPurcItemDate;
    
    @Column(name = "RETURN_PURC_ITEM_ID")
    private Integer returnPurcItemId;
    
    @OneToMany(mappedBy = "lineId", fetch = FetchType.LAZY)
    private Set<SaleLine> saleLinesList;

    public Line() {
    }

    public Line(Integer id) {
        this.id = id;
    }

    public Line(Integer id, int itemId, int purcItemId, boolean deliverItemTf, boolean saleItemTf, boolean blueContTf) {
        this.id = id;
        this.itemId = itemId;
        this.purcItemId = purcItemId;
        this.deliverItemTf = deliverItemTf;
        this.saleItemTf = saleItemTf;
        this.blueContTf = blueContTf;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getItemId() {
        return itemId;
    }

    public void setItemId(int itemId) {
        this.itemId = itemId;
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public String getTelNumber() {
        return telNumber;
    }

    public void setTelNumber(String telNumber) {
        this.telNumber = telNumber;
    }

    public String getLineSerial() {
        return lineSerial;
    }

    public void setLineSerial(String lineSerial) {
        this.lineSerial = lineSerial;
    }

    public Double getLinePrice() {
        return linePrice;
    }

    public void setLinePrice(Double linePrice) {
        this.linePrice = linePrice;
    }

    public int getPurcItemId() {
        return purcItemId;
    }

    public void setPurcItemId(int purcItemId) {
        this.purcItemId = purcItemId;
    }

    public Integer getPurcItemViewNo() {
        return purcItemViewNo;
    }

    public void setPurcItemViewNo(Integer purcItemViewNo) {
        this.purcItemViewNo = purcItemViewNo;
    }

    public Date getPurcItemDate() {
        return purcItemDate;
    }

    public void setPurcItemDate(Date purcItemDate) {
        this.purcItemDate = purcItemDate;
    }

    public boolean getDeliverItemTf() {
        return deliverItemTf;
    }

    public void setDeliverItemTf(boolean deliverItemTf) {
        this.deliverItemTf = deliverItemTf;
    }

    public Integer getDeliverItemId() {
        return deliverItemId;
    }

    public void setDeliverItemId(Integer deliverItemId) {
        this.deliverItemId = deliverItemId;
    }

    public Integer getDeliverItemViewNo() {
        return deliverItemViewNo;
    }

    public void setDeliverItemViewNo(Integer deliverItemViewNo) {
        this.deliverItemViewNo = deliverItemViewNo;
    }

    public Date getDeliverItemDate() {
        return deliverItemDate;
    }

    public void setDeliverItemDate(Date deliverItemDate) {
        this.deliverItemDate = deliverItemDate;
    }

    public boolean getSaleItemTf() {
        return saleItemTf;
    }

    public void setSaleItemTf(boolean saleItemTf) {
        this.saleItemTf = saleItemTf;
    }

    public Integer getSaleItemId() {
        return saleItemId;
    }

    public void setSaleItemId(Integer saleItemId) {
        this.saleItemId = saleItemId;
    }

    public String getSaleItemViewNo() {
        return saleItemViewNo;
    }

    public void setSaleItemViewNo(String saleItemViewNo) {
        this.saleItemViewNo = saleItemViewNo;
    }

    public Date getSaleItemDate() {
        return saleItemDate;
    }

    public void setSaleItemDate(Date saleItemDate) {
        this.saleItemDate = saleItemDate;
    }

    public boolean getBlueContTf() {
        return blueContTf;
    }

    public void setBlueContTf(boolean blueContTf) {
        this.blueContTf = blueContTf;
    }

    public Date getBlueContDate() {
        return blueContDate;
    }

    public void setBlueContDate(Date blueContDate) {
        this.blueContDate = blueContDate;
    }

    public Double getBlueContPrice() {
        return blueContPrice;
    }

    public void setBlueContPrice(Double blueContPrice) {
        this.blueContPrice = blueContPrice;
    }

    public Boolean getSendBlueTf() {
        return sendBlueTf;
    }

    public void setSendBlueTf(Boolean sendBlueTf) {
        this.sendBlueTf = sendBlueTf;
    }

    public Date getSendBlueDate() {
        return sendBlueDate;
    }

    public void setSendBlueDate(Date sendBlueDate) {
        this.sendBlueDate = sendBlueDate;
    }

    public Boolean getSendWhiteTf() {
        return sendWhiteTf;
    }

    public void setSendWhiteTf(Boolean sendWhiteTf) {
        this.sendWhiteTf = sendWhiteTf;
    }

    public Date getSendWhiteDate() {
        return sendWhiteDate;
    }

    public void setSendWhiteDate(Date sendWhiteDate) {
        this.sendWhiteDate = sendWhiteDate;
    }

    public Double getWhiteContPrice() {
        return whiteContPrice;
    }

    public void setWhiteContPrice(Double whiteContPrice) {
        this.whiteContPrice = whiteContPrice;
    }

    public Boolean getContRetTf() {
        return contRetTf;
    }

    public void setContRetTf(Boolean contRetTf) {
        this.contRetTf = contRetTf;
    }

    public Date getContRetDate() {
        return contRetDate;
    }

    public void setContRetDate(Date contRetDate) {
        this.contRetDate = contRetDate;
    }

    public String getContRetNote() {
        return contRetNote;
    }

    public void setContRetNote(String contRetNote) {
        this.contRetNote = contRetNote;
    }

    public Boolean getReturnPurcItemTf() {
        return returnPurcItemTf;
    }

    public void setReturnPurcItemTf(Boolean returnPurcItemTf) {
        this.returnPurcItemTf = returnPurcItemTf;
    }

    public Date getReturnPurcItemDate() {
        return returnPurcItemDate;
    }

    public void setReturnPurcItemDate(Date returnPurcItemDate) {
        this.returnPurcItemDate = returnPurcItemDate;
    }

    public Integer getReturnPurcItemId() {
        return returnPurcItemId;
    }

    public void setReturnPurcItemId(Integer returnPurcItemId) {
        this.returnPurcItemId = returnPurcItemId;
    }

    public Set<SaleLine> getSaleLinesList() {
        return saleLinesList;
    }

    public void setSaleLinesList(Set<SaleLine> saleLinesList) {
        this.saleLinesList = saleLinesList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Line)) {
            return false;
        }
        Line other = (Line) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Line[ id=" + id + " ]";
    }
    
}
